{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "positional argument follows keyword argument (3762797403.py, line 3)",
     "output_type": "error",
     "traceback": [
      "\u001b[0;36m  File \u001b[0;32m\"/tmp/ipykernel_5666/3762797403.py\"\u001b[0;36m, line \u001b[0;32m3\u001b[0m\n\u001b[0;31m    y = np.where(x =0.5, 1-x, y)\u001b[0m\n\u001b[0m                        ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m positional argument follows keyword argument\n"
     ]
    }
   ],
   "source": [
    "x = np.arange(0, 1, 1.0/100)\n",
    "y = np.where(x<0.5, x, 0)\n",
    "y = np.where(x =0.5, 1-x, y)\n",
    "plt.scatter(x,y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/newsun/anaconda3/envs/tensorflow/lib/python3.7/site-packages/numpy/core/_asarray.py:102: ComplexWarning: Casting complex values to real discards the imaginary part\n",
      "  return array(a, dtype, copy=False, order=order)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x7f628655a1d0>]"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi41LCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvSM8oowAAEt5JREFUeJzt3X+MXlWdx/H3l05baFlpoQ1gW7dFuhp0o7CzW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nA9cD7wLOBa7vvzlMWmZW+QWcB9w9Zv064LrZbteAzvUO4K+Bx4HTS9npwONl+cvAFWPqv1Kvli9gefnlfy9wJxD0HiIZOvx6A3cD55XloVIvZvscJnm+JwG/OLzdHb/Gy4AdwMnlut0J/E1XrzOwEnh4qtcWuAL48pjy19SbzFe1PXpe/aXp21nKOqX8uXo2sAU4NTOfKZueBU4ty134WXwR+BRwqKyfAuzNzP5/Th57Tq+cb9n+fKlfk1XAKPC1Mlz1lYhYSIevcWbuAj4PPA08Q++6baPb13msyV7babvmNQd950XEicB3gY9n5m/HbsveW3wnbpmKiA8AuzNz22y3ZQYNAecAN2fm2cALvPqnPNCtawxQhh3W0nuTeyOwkD8c3jgmzPS1rTnodwErxqwvL2WdEBFz6YX8NzPz9lL864g4vWw/Hdhdymv/WZwPXBIRvwRupTd8cyOwKCKGSp2x5/TK+ZbtJwHPzWSDp8FOYGdmbinrt9EL/q5eY4D3Ab/IzNHM3A/cTu/ad/k6jzXZaztt17zmoL8fWF1m7OfRm9TZPMttmhYREcAmYHtmfmHMps1Af+Z9Hb2x+375R8vs/Rrg+TF/Ih71MvO6zFyemSvpXcd7M/PDwH3AZaXa4efb/zlcVupX1fPNzGeBHRHxllJ0AfAoHb3GxdPAmohYUH7H++fc2et8mMle27uB90fE4vLX0PtL2eTN9oTFEU52XAz8D/Bz4DOz3Z5pPK+/pPdn3YPAz8rXxfTGJ+8BngD+Czi51A96dyD9HHiI3l0Ns34eUzz39wB3luUzgJ8AI8B/APNL+fFlfaRsP2O22z3Fc30nsLVc5+8Bi7t+jYHPAo8BDwP/Dszv4nUGvkVvHmI/vb/e1k/l2gJ/X85/BLhyqu3xyVhJ6riah24kSRNg0EtSxxn0ktRxBr0kdZxBL0kdZ9BLUscZ9JLUcQa9JHXc/wPyDRh6idEkWgAAAABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "f = np.fft.fft(y)\n",
    "plt.plot(np.arange(len(f)),f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "1ef72a13f3013e847e3bd8a33f051d4a412532529eb6f148abce49204c274f51"
  },
  "kernelspec": {
   "display_name": "Python 3.7.10 64-bit ('tensorflow': conda)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.10"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
